package com.fone.player.airone;

import java.util.Hashtable;


public class MatchEvent {

	public static interface IMatchEvent{
		public boolean isMatchEvent(int event);
		public void onMatchEvent();
		public String getEventKey();
	}
	
	static Hashtable<String,IMatchEvent> datas = new Hashtable();
	public static void addEvent(IMatchEvent ime){
		if( datas.containsKey(ime.getEventKey()) )
			datas.remove(ime.getEventKey());
		datas.put(ime.getEventKey(),ime);
	}
	public static void filter(String key,int eventid){
		if( datas.containsKey(key) ){
			if( datas.get(key).isMatchEvent(eventid) ){
				datas.get(key).onMatchEvent();
				datas.remove(key);
			}
		}
	}
	
}
